package com.mmall.dto;

import com.google.common.collect.Lists;
import com.mmall.pojo.SysDept;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.beans.BeanUtils;

import java.util.List;

/**
 * 部门层级数据传输对象
 * @Author wangtengyu
 * @Create 2018-03-07-15:52
 */
@Getter
@Setter
@ToString
public class DeptLevelDto extends SysDept {

    //一个层级的底下,还可能有多个层级,用于嵌套递归
    private List<DeptLevelDto> deptList = Lists.newArrayList();

    public static DeptLevelDto adpat(SysDept sysDept){
        DeptLevelDto DeptLevelDto =new DeptLevelDto();
        BeanUtils.copyProperties(sysDept, DeptLevelDto);
        return DeptLevelDto;
    }

}
